//
//  HomeComDataView.m
//  Ginix
//
//  Created by fzq on 2025/2/23.
//

#import "HomeComDataView.h"

@interface HomeComDataView()
@property (nonatomic,strong) UILabel * nameLabel;
@property (nonatomic,strong) UILabel * infoLabel;
@end

@implementation HomeComDataView

-(instancetype)initWithFrame:(CGRect)frame{
    
    if(self = [super initWithFrame:frame]){
        [self setSubViewLayout];
    }
    return self;
}

-(void)setSubViewLayout{
    
    [self setCornerRadius:4 * FMScaleX borderWidth:1 borderColor:RDRGB(0xDED8CE)];
    
    [self addSubview:self.nameLabel];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15 * FMScaleX);
        make.top.mas_offset(10 * FMScaleX);
    }];
    [self addSubview:self.infoLabel];
    [_infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.right.mas_offset(-15* FMScaleX);
        make.bottom.mas_offset(-5 * FMScaleX);
        make.top.equalTo(self.nameLabel.mas_bottom).offset(5 * FMScaleX);
    }];
}
-(UILabel *)nameLabel{
    
    if(!_nameLabel){
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.font = Bold(20);
        _nameLabel.textColor = RDRGB(0xAD7D62);
    }
    return _nameLabel;
}
-(UILabel *)infoLabel{
    
    if(!_infoLabel){
        _infoLabel = [[UILabel alloc]init];
        _infoLabel.font = Regular(12);
        _infoLabel.textColor = RDRGB(0x666666);
        _infoLabel.numberOfLines = 0;
    }
    return _infoLabel;
}
@end
